Ext.define('testleo.view.Blog', {
    extend: 'Ext.navigation.View',
    xtype: 'blog',
    
    requires: [
        'Ext.dataview.List',
        'Ext.data.proxy.JsonP',
        'Ext.data.Store'
    ],
    
    config: {
        title: 'About',
        iconCls: 'star',
        
        scrollable: true,
        styleHtmlContent: true,
        
        items: {
            xtype: 'list',
            itemTpl:'<div class="post">' +
			'<h3>{title}</h3>' +
			'<div class="meta">by {author} - {date}</div>' +
	            '</div>',
            
            title: 'Recent Posts',
            
            store: {
                autoLoad: true,
                fields: ['title', 'date', 'author', 'content'],
                
                proxy: {
                    type: 'ajax',
                    method: 'POST',
                    url: 'http://localhost/app-test/app-getposts.php',
                    //url: 'http://djavupixel.com/app-getposts.php',
                    reader: {
                        type: 'json',
                        rootProperty: 'posts'
                    }
                }
            }
        }
	
    }
    
//    initialize: function() {
//        this.callParent(arguments);
//	var myStore = this.down('list').getStore();
//	 //console.log(myStore);
//	 
//	myStore.load({
//	    callback: function(records, operation, success) {
//		// the operation object contains all of the details of the load operation
//		console.log(records);
//	    }
//	});
//		
//    }
    
    
})